\hypertarget{class_thread}{\section{Thread类 参考}
\label{class_thread}\index{Thread@{Thread}}
}


线程类  




{\ttfamily \#include $<$Thread.\+h$>$}

\subsection*{Public 成员函数}
\begin{DoxyCompactItemize}
\item 
bool \hyperlink{class_thread_a50d2b493c38b7ee1ada21a575885caa0}{start} (\hyperlink{class_runnable_protocol}{Runnable\+Protocol} $\ast$p\+Runnable)
\begin{DoxyCompactList}\small\item\em 启动线程 \end{DoxyCompactList}\item 
bool \hyperlink{class_thread_a5d52b4357af2956e10fd72d80d540cf1}{cancel} ()
\begin{DoxyCompactList}\small\item\em 取消线程 \end{DoxyCompactList}\item 
bool \hyperlink{class_thread_ab17a6bee5b20a1e32734b19a93314b7a}{is\+Running} ()
\begin{DoxyCompactList}\small\item\em 判断线程是否正在运行 \end{DoxyCompactList}\item 
\hypertarget{class_thread_a799b31053c5711aa201e6226d17bf0c2}{pthread\+\_\+t {\bfseries get\+Thread\+I\+D} ()}\label{class_thread_a799b31053c5711aa201e6226d17bf0c2}

\item 
\hypertarget{class_thread_a74c77055433638874fc868b2701f432f}{sint32 {\bfseries get\+Thread\+Status} ()}\label{class_thread_a74c77055433638874fc868b2701f432f}

\end{DoxyCompactItemize}
\subsection*{静态 Public 成员函数}
\begin{DoxyCompactItemize}
\item 
static void \hyperlink{class_thread_a349ae9516ca507d3705abd13b40c68f9}{msleep} (sint32 ms)
\begin{DoxyCompactList}\small\item\em 线程休眠 \end{DoxyCompactList}\item 
static sint32 \hyperlink{class_thread_a9f8e7036a229da5ff532e1f17316c3d0}{create\+Task} (\hyperlink{class_runnable_protocol}{Runnable\+Protocol} $\ast$owner, S\+E\+L\+\_\+task task, void $\ast$task\+Arg)
\begin{DoxyCompactList}\small\item\em 创建任务(子线程) \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{详细描述}
线程类 

\subsection{成员函数说明}
\hypertarget{class_thread_a5d52b4357af2956e10fd72d80d540cf1}{\index{Thread@{Thread}!cancel@{cancel}}
\index{cancel@{cancel}!Thread@{Thread}}
\subsubsection[{cancel}]{\setlength{\rightskip}{0pt plus 5cm}bool Thread\+::cancel (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)}}\label{class_thread_a5d52b4357af2956e10fd72d80d540cf1}


取消线程 


\begin{DoxyParams}{参数}
{\em void} & \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{返回}
void 
\end{DoxyReturn}
\begin{DoxyNote}{注解}
none 
\end{DoxyNote}
\hypertarget{class_thread_a9f8e7036a229da5ff532e1f17316c3d0}{\index{Thread@{Thread}!create\+Task@{create\+Task}}
\index{create\+Task@{create\+Task}!Thread@{Thread}}
\subsubsection[{create\+Task}]{\setlength{\rightskip}{0pt plus 5cm}sint32 Thread\+::create\+Task (
\begin{DoxyParamCaption}
\item[{{\bf Runnable\+Protocol} $\ast$}]{owner, }
\item[{S\+E\+L\+\_\+task}]{task, }
\item[{void $\ast$}]{task\+Arg}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [static]}}}\label{class_thread_a9f8e7036a229da5ff532e1f17316c3d0}


创建任务(子线程) 


\begin{DoxyParams}{参数}
{\em p\+Runnable} & Runnable\+Protocol对象 \\
\hline
{\em task} & 任务方法 \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{返回}
成功返回\+S\+T\+A\+T\+U\+S\+\_\+\+O\+K,失败返回\+S\+T\+A\+T\+U\+S\+\_\+\+E\+R\+R\+O\+R 
\end{DoxyReturn}
\begin{DoxyNote}{注解}
none 
\end{DoxyNote}
\hypertarget{class_thread_ab17a6bee5b20a1e32734b19a93314b7a}{\index{Thread@{Thread}!is\+Running@{is\+Running}}
\index{is\+Running@{is\+Running}!Thread@{Thread}}
\subsubsection[{is\+Running}]{\setlength{\rightskip}{0pt plus 5cm}bool Thread\+::is\+Running (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)}}\label{class_thread_ab17a6bee5b20a1e32734b19a93314b7a}


判断线程是否正在运行 


\begin{DoxyParams}{参数}
{\em void} & \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{返回}
正在运行返回true,否则返回false 
\end{DoxyReturn}
\begin{DoxyNote}{注解}
none 
\end{DoxyNote}
\hypertarget{class_thread_a349ae9516ca507d3705abd13b40c68f9}{\index{Thread@{Thread}!msleep@{msleep}}
\index{msleep@{msleep}!Thread@{Thread}}
\subsubsection[{msleep}]{\setlength{\rightskip}{0pt plus 5cm}void Thread\+::msleep (
\begin{DoxyParamCaption}
\item[{sint32}]{ms}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [static]}}}\label{class_thread_a349ae9516ca507d3705abd13b40c68f9}


线程休眠 


\begin{DoxyParams}{参数}
{\em ms} & 毫秒数 \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{返回}
void 
\end{DoxyReturn}
\begin{DoxyNote}{注解}
none 
\end{DoxyNote}
\hypertarget{class_thread_a50d2b493c38b7ee1ada21a575885caa0}{\index{Thread@{Thread}!start@{start}}
\index{start@{start}!Thread@{Thread}}
\subsubsection[{start}]{\setlength{\rightskip}{0pt plus 5cm}bool Thread\+::start (
\begin{DoxyParamCaption}
\item[{{\bf Runnable\+Protocol} $\ast$}]{p\+Runnable}
\end{DoxyParamCaption}
)}}\label{class_thread_a50d2b493c38b7ee1ada21a575885caa0}


启动线程 


\begin{DoxyParams}{参数}
{\em p\+Runnable} & Runnable\+Protocol对象 \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{返回}
成功返回true,失败返回false 
\end{DoxyReturn}
\begin{DoxyNote}{注解}
none 
\end{DoxyNote}


该类的文档由以下文件生成\+:\begin{DoxyCompactItemize}
\item 
libemb/inc/\hyperlink{_thread_8h}{Thread.\+h}\item 
libemb/src/Thread.\+cpp\end{DoxyCompactItemize}
